<!DOCTYPE html>
<!--
Copyright (c) 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/settings.html">
<link rel="import" href="/tracing/ui/base/mouse_mode_icon.html">
<script>
'use strict';

tr.b.unittest.testSuite(function() {
  const MOUSE_SELECTOR_MODE = tr.ui.b.MOUSE_SELECTOR_MODE;

  test('inactive', function() {
    const icon = document.createElement('tr-ui-b-mouse-mode-icon');
    icon.mode = MOUSE_SELECTOR_MODE.SELECTION;
    assert.strictEqual(icon.modeName, 'SELECTION');
    icon.acceleratorKey = 'a';
    this.addHTMLOutput(icon);
  });

  test('active', function() {
    const icon = document.createElement('tr-ui-b-mouse-mode-icon');
    icon.mode = MOUSE_SELECTOR_MODE.SELECTION;
    assert.strictEqual(icon.modeName, 'SELECTION');
    icon.active = true;
    this.addHTMLOutput(icon);
  });

  test('modeNameSetter', function() {
    const icon = document.createElement('tr-ui-b-mouse-mode-icon');
    Polymer.dom(icon).setAttribute('mode-name', 'SELECTION');
    this.addHTMLOutput(icon);

    return Promise.resolve().then(function() {
      assert.strictEqual(icon.mode, 1);
    });
  });
});
</script>
